package com.sailfish.springbootdemo.dao.db4;

import com.sailfish.springbootdemo.common.DB4TableName;
import com.sailfish.springbootdemo.pojo.db4.Usergroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UsergroupDao {

    /**
     * 查询所有的
     */
    @Select("select from " + DB4TableName.USERGROUP + " order by sort ")
    List<Usergroup> getAllUsergroup();

    /**
     * 根据 名字查
     */
    @Select("select * from " + DB4TableName.USERGROUP + " where usergroup = #{usergroup} limit 1")
    Usergroup getByName(@Param("usergroup")String usergroup);
}
